package com.glory.dmegcpda.fragment

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.glory.dmegcpda.R
import com.glory.dmegcpda.view.*
import com.glory.dmegcpda.viewmodel.FirstFragmentModel
import com.glory.mvvmnet.base.BaseFragment
import kotlinx.android.synthetic.main.gttext_fragment.*
import kotlinx.android.synthetic.main.qltext_fragment.*
import kotlinx.android.synthetic.main.qltext_fragment.llQualityLayout

class QlTextFragment : BaseFragment<FirstFragmentModel>(), View.OnClickListener {

    override fun layoutId(): Int {
        return R.layout.qltext_fragment
    }

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        llQualityLayout.setOnClickListener(this)
        llPatrol.setOnClickListener(this)

    }

    override fun initData() {
        super.initData()

    }

    override fun onClick(p: View?) {
        val intent = Intent()
        when (p?.id) {
            R.id.llQualityLayout ->{
                activity?.let { intent.setClass(it, QualityCheckActivity::class.java) }
            }
            R.id.llPatrol ->{
                activity?.let { intent.setClass(it, QualityPatrolActivity::class.java) }
            }
        }
        startActivity(intent)
    }

}